package cn.tiga.controller;



import cn.tiga.domain.Role;
import cn.tiga.service.impl.RoleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private RoleServiceImpl roleServer;

    @GetMapping()
    public List loadAll() {
        return roleServer.loadAll();
    }

    @GetMapping("/loadById/{id}")
    public Role loadById(@PathVariable("id") Long id) {
        System.out.println(1);
        return roleServer.loadById(id);
    }
}
